﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CurrencyManagement.aspx.cs" Inherits="Admin_CurrencyManagement" %>
<%@ Import Namespace="Money.Data" %>

<asp:Content ID="Content1" ContentPlaceHolderID="scriptCssContent" Runat="Server">
    <link href="../css/tables.css" type="text/css" rel="Stylesheet" />
    <link type="text/css" rel="Stylesheet" href="../css/form.css" />
    <script language="javascript" type="text/javascript" src="../js/common.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="titlePlaceHolder" Runat="Server">
    <asp:literal id="pageTitle" runat="server"></asp:literal>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="menuPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="contentPlaceHolder" Runat="Server">
    <asp:label id="messageLabel" runat="server" cssclass="ErrorMessage"></asp:label><%= messageLabel.Visible == true ? "<br /><br />" : "" %>
    <one:repeater id="repeaterCurrencies" runat="server">
        <headertemplate>
            <table class="Grid">
                <thead>
                    <tr>
                        <th class="Check"><input type="checkbox" id="checkAll" onclick="choiceBehavior.doCheckAll(this.checked)" /></th>
                        <th><a href="<%= GetOrderByLink(CurrencyOrderBy.Id.ToString()) %>"><%= Resources.Strings.CurrencyId %></a><%= GetOrderDirectionIndicator(CurrencyOrderBy.Id.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(CurrencyOrderBy.Name.ToString()) %>"><%= Resources.Strings.Name %></a><%= GetOrderDirectionIndicator(CurrencyOrderBy.Name.ToString())%></th>
                        <th><a href="<%= GetOrderByLink(CurrencyOrderBy.Rate.ToString()) %>"><%= Resources.Strings.Rate %></a><%= GetOrderDirectionIndicator(CurrencyOrderBy.Rate.ToString())%></th>
                        <th><%= Resources.Strings.Action %></th>
                    </tr>
                </thead>
                <tbody>
        </headertemplate>
        <itemtemplate>
                    <tr>
                        <td class="Check"><input type="checkbox" id="selectedCheckBox<%# Container.ItemIndex %>" name="selectedItems" value="<%# Eval(CurrencyOrderBy.Id.ToString()) %>" onclick="choiceBehavior.checkChanged(this.checked)"/></td>
                        <td class="Number"><%# One.Web.HttpUtility.HtmlEncode(Eval(CurrencyOrderBy.Id.ToString()))%></td>
                        <td><%# One.Web.HttpUtility.HtmlEncode(Eval(CurrencyOrderBy.Name.ToString()))%></td>
                        <td class="Number"><%# One.Web.HttpUtility.HtmlEncode(Eval(CurrencyOrderBy.Rate.ToString()))%></td> 
						<td>
						    <a href="EditCurrency.aspx?currencyId=<%# Eval(CurrencyOrderBy.Id.ToString()) %>"><%= Resources.Strings.Edit %></a>
						</td>
                    </tr>
        </itemtemplate>
        <nonetemplate>
                    <tr>
                        <td colspan="5"><%= Resources.Strings.NoItem %></td>
                    </tr>
        </nonetemplate>
        <footertemplate>
                </tbody>
            </table>
        </footertemplate>
    </one:repeater>
    <div class="Pagination">
        <one:pager id="pager" runat="server" parameter="Page" pagesize="5"></one:pager> 
    </div>
    <div class="ActionRow">
        <asp:button runat="server" id="deleteButton" text="<%$ Resources:Strings,Delete %>" onclick="DeleteCurrencies" />      
        <input type="button" value="<%= Resources.Strings.Add %>" onclick="window.location = 'EditCurrency.aspx';" />
    </div>
    <script language="javascript" type="text/javascript">
        choiceBehavior.totalItems = <%= currencies == null ? 0 : currencies.Count%>;
        choiceBehavior.btnActions = new Array();
        choiceBehavior.btnActions[0] = getControl('<%= deleteButton.ClientID%>');
        choiceBehavior.checkAll = getControl('checkAll');
        choiceBehavior.init();
    </script>    
</asp:Content>

